Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anyReplica setting for ReadFrom #1444

Closed
wants to merge 1 commit into from

Conversation

omer-cilingir
Copy link

A ReadFrom setting for reading from only all replicas

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #1444 into main will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1444      +/-   ##
============================================
+ Coverage     78.80%   78.86%   +0.05%     
- Complexity     6181     6186       +5     
============================================
  Files           460      460              
  Lines         20800    20805       +5     
  Branches       2302     2303       +1     
============================================
+ Hits          16392    16408      +16     
+ Misses         3341     3336       -5     
+ Partials       1067     1061       -6     
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/lettuce/core/ReadFrom.java 76.47% <100.00%> (+2.27%) 11.00 <0.00> (+1.00)
src/main/java/io/lettuce/core/ReadFromImpl.java 91.66% <100.00%> (+0.49%) 2.00 <0.00> (ø)
...java/io/lettuce/core/protocol/DefaultEndpoint.java 69.60% <0.00%> (-0.47%) 99.00% <0.00%> (ø%)
.../io/lettuce/core/protocol/ReconnectionHandler.java 79.72% <0.00%> (ø) 22.00% <0.00%> (ø%)
src/main/java/io/lettuce/core/ScanStream.java 87.82% <0.00%> (+1.28%) 24.00% <0.00%> (ø%)
.../java/io/lettuce/core/protocol/CommandHandler.java 75.38% <0.00%> (+1.79%) 112.00% <0.00%> (+3.00%)
...a/io/lettuce/core/protocol/ConnectionWatchdog.java 82.35% <0.00%> (+2.61%) 40.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f75b85...a1476ca. Read the comment docs.

@mp911de
Copy link
Collaborator

mp911de commented Oct 6, 2020

Care to elaborate on why ReadFrom.ANY isn't sufficient?

@omer-cilingir
Copy link
Author

Sorry for not explanation,
All the write commands go to the master node, the master is already busy and has high CPU usage, so the get commands go to only the replicas, so we can distribute the load & CPU usage.
This setting may be useful for applications whose the write is half the read.

@mp911de
Copy link
Collaborator

mp911de commented Oct 6, 2020

Thanks a lot. From that perspective, it makes sense to add another constant.

@mp911de mp911de added the type: feature A new feature label Oct 6, 2020
@mp911de mp911de added this to the 6.0.1 milestone Oct 26, 2020
mp911de pushed a commit that referenced this pull request Oct 26, 2020
mp911de added a commit that referenced this pull request Oct 26, 2020
Update since tags. Add author tags.

Original pull request: #1444
mp911de pushed a commit that referenced this pull request Oct 26, 2020
mp911de added a commit that referenced this pull request Oct 26, 2020
Update since tags. Add author tags.

Original pull request: #1444
@mp911de
Copy link
Collaborator

mp911de commented Oct 26, 2020

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants